package com.itbaizhan.mapper2;

import com.itbaizhan.pojo.Student;

import java.util.List;

/*分解式查询*/
/*# 查询班级时关联查询出学生
select *
  from classes
  left join student
  on student.classId = classes.cid

  也可以使用分解式查询，即将一个连接Sql语句分解为多条Sql语句，如：

# 查询班级时关联查询出学生
select * from classes;
select * from student where classId = 1;
select * from student where classId = 2; */
public interface StudentMapper2 {
    //一对多分解式查询
    //根据班级ID查询   从表
    List<Student> findByClassId(int classId);
    List<Student> selectByClassId(int classId);
    //一对一 分解式查询  主表   select * from student
    //    select * from classes where cid = ?
    List<Student> findAll();
    List<Student> selectAll();
}
